﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'proc_cm_SaveMemberToSmallGroup')
BEGIN
    PRINT 'Dropping Procedure proc_cm_SaveMemberToSmallGroup'
    DROP  Procedure  proc_cm_SaveMemberToSmallGroup
END
GO

PRINT 'Creating Procedure proc_cm_SaveMemberToSmallGroup'
GO

CREATE PROCEDURE [dbo].[proc_cm_SaveMemberToSmallGroup]
	@pMemberId int, 
	@pSmallGroupId uniqueidentifier
AS
BEGIN
	SET NOCOUNT ON
	
	UPDATE [dbo].[tbl_member]
	SET [smallgroup_id] = @pSmallGroupId
	WHERE [member_id] = @pMemberId
END
GO

GRANT EXEC ON dbo.proc_cm_SaveMemberToSmallGroup TO PUBLIC
GO

